<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8" />
		<meta http-equiv="X-UA-Compatible" content="IE=Edge">
		<title>{$pageData.title}</title>
		<link rel="stylesheet" href="__STATIC__/home/js/layui/css/layui.css" />
		<link rel="stylesheet" href="__STATIC__/home/css/admin.css" />
		<script type="text/javascript" src="__STATIC__/home/js/jquery.min.js"></script>
		<script type="text/javascript" src="__STATIC__/home/js/layui/layui.js"></script>
	</head>
	<body class="pd30" data-id="accountWithdraw">
		<div class="center-nav f20">{$pageData.title}<a href="{:url('account.show/record_withdraw')}">提现申请记录</a></div>
        <div class="center-from b-w">
        	<form class="layui-form" name="postForm" method="post" action="{:url('account.handle/withdraw')}">
				<ul class="center-from-ul clearfix">
					<li class="width6">
						<div class="layui-form-item">
							<label class="layui-form-label">提现账户</label>
							<div class="layui-input-block">
								<select class="input" name="bank_card" lay-verify="required" id="bankCard">
									<option value="">请选择银行卡</option>
								</select>
							</div>
						</div>
					</li>
					<li class="width6">
						<div class="layui-form-item">
							<label class="layui-form-label">提现货币</label>
							<div class="layui-input-block">
								<select class="input" name="coin_id" lay-verify="required" lay-filter="withdrawCoin" id="accountWithdraw"></select>
							</div>
						</div>
					</li>
					<li class="width6">
						<div class="layui-form-item">
							<label class="layui-form-label">可提金额</label>
							<div class="layui-input-block">
								<input type="text" lay-name="可提金额" lay-verify="empty" autocomplete="off" placeholder="可提金额" readonly="readonly" class="layui-input" id="Available">
							</div>
						</div>
					</li>
					<li class="width6">
						<div class="layui-form-item">
							<label class="layui-form-label">提现金额</label>
							<div class="layui-input-block">
								<input type="text" name="amount" lay-name="提现金额" lay-verify="empty" autocomplete="off" placeholder="请输入提现金额" class="layui-input">
							</div>
						</div>
					</li>
					<li class="width6">
						<div class="layui-form-item">
							<label class="layui-form-label">验证码</label>
							<div class="layui-input-block">
								<input type="text" name="captcha" lay-name="验证码" lay-verify="empty" autocomplete="off" placeholder="请输入验证码" class="layui-input">
							</div>
						</div>
					</li>
					<li>
						<div class="layui-form-item">
							<label class="layui-form-label"></label>
							<div class="layui-input-block" id="Verify" onclick="refreshVerify()">
								{:captcha_img()}
							</div>
						</div>
					</li>
					<li class="width6" style="display: none;">
						<input type="text" name="token" value="{$token}">
					</li>
				</ul>
				<p class="center-from-p"><input type="button" lay-submit="submit" lay-filter="WithdrawSubmit" class="layui-btn layui-bg-orange" value="立即提现"></p>
			</form>
			
		</div>
       

<script type="text/javascript">
$(function(){
	getCoinConfig();
	bankCards();
})

// 提现账户列表
function bankCards(){
	$.ajax({
		'type':'post',
		'dataType':'json',
		'url':"{:url('bank.api/bank_card')}",
		'success':function(data){
			var html = '';
			$.each(data,function(index,value){
				html += '<option value="'+value.id+'">'+value.bank_name+'|'+value.bank_card+'|'+value.owner+'</option>';
			});
			$("select[name=bank_card]").html(html);
		}
	});
}
// 提现货币
function getCoinConfig(){
	$.ajax({
		'type':'post',
		'dataType':'json',
		'url':"{:url('account.api/withdraw_coin')}",
		'success':function(data){
			var html = '<option value="">选择提现货币</option>';
			$.each(data,function(index,value){
				html += '<option value="'+value.coin_id+'">'+value.coin_name+'</option>';
			});
			$("select[name=coin_id]").html(html);
		}
	});
}
// 余额查询接口
function account(coinId){
	if(!coinId){
		return false;
	}
	$.ajax({
		'type':'post',
		'dataType':'json',
		'url':"{:url('account.api/coin')}",
		'data':'id='+coinId,
		'success':function(data){
			$("#account").val(data.amount);
		}
	});
}
</script>
         <script>
         	var bankCard="{:url('bank.api/bank_card')}";
         	var ycoin="{:url('account.api/coin')}";
			var withdraw="{:url('account.handle/withdraw')}";
			var withdrawCoin="{:url('account.api/withdraw_coin')}";
		</script>
		<script type="text/javascript" src="__STATIC__/home/js/public.js"></script>
</body>
</html>